<?php
namespace app\erp_meixingtiyu\controller;

use think\facade\Request;
use app\store\controller\Controller as StoreController;
use app\erp_meixingtiyu\logic\Contact as ContactLogic;

class Contact extends StoreController
{
    // 获取网站联系信息
    public function info()
    {
      $info = ContactLogic::getInfo();
      return $this->renderSuccess($info);
    }

    public function update()
    {
        $params = Request::only([
            'cnname',
            'address',
            'image_id',
            'opening',
            'phone',
        ]);

        $info = ContactLogic::updateInfo($params);
        return $this->renderSuccess($info->toArray(), '更新成功');
    }
}
